A = {"足球", "游泳", "羽毛球", "乒乓球"}
B = {"篮球", "乒乓球", "羽毛球", "排球"}

# 并集
print(A | B)    # 1-并集
print(A.union(B))   # 2-并集
print(A)    # A不发生变化

# 交集
print(A & B)    # 1-交集
print(A.intersection(B))    # 2-交集

# 差集
print(A - B)    # 1-求差集
print(A.difference(B))  # 2-求差集

# 异或集
print(A ^ B)    # 1-求异或集
print(A.symmetric_difference(B))    # 2-求异或集


